package controllers

import (
	"go-jhb-admin-api/app/models"
	"go-jhb-admin-api/app/utils"

	"github.com/gin-gonic/gin"
)

func Index(c *gin.Context) {

}

func Userinfo(c *gin.Context) {

	admin_id := c.GetUint("admin_id")

	// 获取当前管理员详情
	admin := models.Admin{}

	err := admin.GetByID(admin_id)
	if err != nil {
		utils.ErrorResponse(c, nil, err)
		return
	}

	utils.SuccessResponse(c, admin, "获取成功")
}
